package com.kly.manager.websocket.enums;

import lombok.Getter;

@Getter
public enum PictureCommentMessageTypeEnum {

    INFO("发送通知", "INFO"),
    ERROR("发送错误", "ERROR"),
    ENTER_COMMENT("进入评论状态", "ENTER_COMMENT"),
    EXIT_COMMENT("退出评论状态", "SEND_MESSAGE"),
    COMMENT_ACTION("执行评论操作", "COMMENT_ACTION");

    private final String text;
    private final String value;

    PictureCommentMessageTypeEnum(String text, String value) {
        this.text = text;
        this.value = value;
    }

    /**
     * 根据 value 获取枚举
     */
    public static PictureCommentMessageTypeEnum getEnumByValue(String value) {
        if (value == null || value.isEmpty()) {
            return null;
        }
        for (PictureCommentMessageTypeEnum typeEnum : PictureCommentMessageTypeEnum.values()) {
            if (typeEnum.value.equals(value)) {
                return typeEnum;
            }
        }
        return null;
    }
}
